package com.evolver.datatest.controller;

import com.evolver.datatest.model.dao.UserMapper;
import com.evolver.datatest.model.dao.test2.CodeMapper;
import com.evolver.datatest.model.dao.test2.VoiceMapper;
import com.evolver.datatest.model.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wenl
 * @version V2.0
 * @project 自己的框架
 * @package com.evolver.datatest.controller
 * @date 2020/3/23
 * @describe
 */
@RestController
public class Hello {

    @Autowired
    private UserMapper userMapper;

    @Autowired
    private VoiceMapper voiceMapper;

    @GetMapping("/hi/{name}")
    public Object hello(@PathVariable String name){
        if(name.equals("user")){
            User user = new User();
            user = userMapper.selectByPrimaryKey(1L);
            return user;
        }else{
            System.out.println(voiceMapper);
            return voiceMapper.selectByPrimaryKey(1L);
        }

    }
}
